#!/bin/bash

rlogin=$1
rhost=$2
rdir=$3

print_usage()
{
   echo "Usage: $0 <login> <remote host> <remote dir>"
   echo "List the content of the given directory on the given"
   echo "remote host by using SFTP protocol."
}

if [ "x$rdir" == "x" ]; then
   echo "[ERROR] All arguments not available."
   print_usage
   exit 1
fi

sftp $rlogin@$rhost <<EOSFTP
cd $rdir
dir
quit
EOSFTP


